-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: fast bridge router v2 #330
Conversation
WalkthroughThe Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Pull Request Test Coverage Report for Build 10214812664Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (3)
test/mocks/MockSenderContract.sol (1)
1-2
: Add a newline after the SPDX license identifier.For readability and consistency, add a newline after the SPDX license identifier.
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0;test/rfq/FastBridgeRouter.QuoterV1.t.sol (1)
7-7
: Update all references to the old contract nameThe contract name
FastBridgeRouterNativeTest
is still being referenced in several files. Please update these references to the new contract nameFastBridgeRouterQuoterV1Test
.
test/rfq/FastBridgeRouterV2.Native.t.sol
- Line:
import {FastBridgeRouterNativeTest, IFastBridge, SwapQuery} from "./FastBridgeRouter.Native.t.sol";
- Line:
abstract contract FastBridgeRouterV2NativeTest is FastBridgeRouterNativeTest {
test/rfq/FastBridgeRouter.Native.t.sol
- Line:
abstract contract FastBridgeRouterNativeTest is FBRTest {
test/rfq/FastBridgeRouter.Native.QuoterV2.t.sol
- Line:
import {FastBridgeRouterNativeTest} from "./FastBridgeRouter.Native.t.sol";
- Line:
contract FastBridgeRouterNativeQuoterV2Test is FastBridgeRouterNativeTest {
test/rfq/FastBridgeRouter.Native.QuoterV1.t.sol
- Line:
import {FastBridgeRouterNativeTest} from "./FastBridgeRouter.Native.t.sol";
- Line:
contract FastBridgeRouterNativeQuoterV1Test is FastBridgeRouterNativeTest {
Analysis chain
LGTM! Ensure all references to the old contract name are updated.
The contract name has been changed to
FastBridgeRouterQuoterV1Test
. Ensure that all references to the old contract name are updated throughout the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all references to the old contract name are updated. # Test: Search for the old contract name. Expect: No occurrences of the old contract name. rg --type solidity -A 5 $'FastBridgeRouterNativeTest'Length of output: 85
Script:
#!/bin/bash # Description: Verify that all references to the old contract name are updated. # Test: Search for the old contract name in all files. Expect: No occurrences of the old contract name. rg 'FastBridgeRouterNativeTest'Length of output: 885
test/rfq/FastBridgeRouterV2.Native.QuoterV1.t.sol (1)
1-2
: Add a newline after the SPDX license identifier.For readability and consistency, add a newline after the SPDX license identifier.
// SPDX-License-Identifier: MIT pragma solidity 0.8.17;
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (12)
- contracts/rfq/FastBridgeRouterV2.sol (1 hunks)
- test/mocks/MockSenderContract.sol (1 hunks)
- test/rfq/FBRTest.sol (3 hunks)
- test/rfq/FastBridgeRouter.Native.t.sol (23 hunks)
- test/rfq/FastBridgeRouter.QuoterV1.t.sol (1 hunks)
- test/rfq/FastBridgeRouter.t.sol (8 hunks)
- test/rfq/FastBridgeRouterV2.Native.QuoterV1.t.sol (1 hunks)
- test/rfq/FastBridgeRouterV2.Native.QuoterV2.t.sol (1 hunks)
- test/rfq/FastBridgeRouterV2.Native.t.sol (1 hunks)
- test/rfq/FastBridgeRouterV2.QuoterV1.t.sol (1 hunks)
- test/rfq/FastBridgeRouterV2.QuoterV2.t.sol (1 hunks)
- test/rfq/FastBridgeRouterV2.t.sol (1 hunks)
Additional comments not posted (64)
test/mocks/MockSenderContract.sol (1)
7-9
: Ensure proper error handling for external calls.The
doCall
function usesAddress.functionCallWithValue
which reverts on failure. Ensure that this behavior is intended and that any potential reverts are properly handled in the calling code.test/rfq/FastBridgeRouter.QuoterV1.t.sol (2)
Line range hint
8-20
:
LGTM! Ensure the constructor arguments are correct.The
setUpSwapQuoter
function deploys theSwapQuoter
contract with specific constructor arguments. Ensure that these arguments are correct and that thedeployCode
function works as expected.
Line range hint
23-27
:
LGTM! Ensure theaddPool
function works as expected.The
addPool
function adds a pool to theSwapQuoter
contract. Ensure that theaddPools
function of theISwapQuoterV1
interface works as expected.test/rfq/FastBridgeRouterV2.Native.QuoterV1.t.sol (2)
7-20
: LGTM! Ensure the constructor arguments are correct.The
setUpSwapQuoter
function deploys theSwapQuoter
contract with specific constructor arguments. Ensure that these arguments are correct and that thedeployCode
function works as expected.
23-27
: LGTM! Ensure theaddPool
function works as expected.The
addPool
function adds a pool to theSwapQuoter
contract. Ensure that theaddPools
function of theISwapQuoterV1
interface works as expected.test/rfq/FastBridgeRouterV2.QuoterV1.t.sol (2)
8-22
: Verify the use of hardcoded addresses.The function sets up the SwapQuoter V1 using hardcoded addresses for
synapseRouter
andweth
. Ensure these addresses are correct and intentional for the test.
24-28
: Verify the hardcoded pool address.The function adds a pool to the SwapQuoter V1 using a hardcoded pool address. Ensure this address is correct and intentional for the test.
test/rfq/FastBridgeRouterV2.Native.QuoterV2.t.sol (2)
9-21
: Verify the use of hardcoded addresses.The function sets up the SwapQuoter V2 using hardcoded addresses for
synapseRouter
,defaultPoolCalc
, andweth
. Ensure these addresses are correct and intentional for the test.
23-31
: Verify the hardcoded pool address.The function adds a pool to the SwapQuoter V2 using a hardcoded pool address. Ensure this address is correct and intentional for the test.
test/rfq/FastBridgeRouterV2.QuoterV2.t.sol (2)
9-21
: Verify the use of hardcoded addresses.The function sets up the SwapQuoter V2 using hardcoded addresses for
synapseRouter
,defaultPoolCalc
, andweth
. Ensure these addresses are correct and intentional for the test.
24-31
: Verify the hardcoded pool address.The function adds a pool to the SwapQuoter V2 using a hardcoded pool address. Ensure this address is correct and intentional for the test.
test/rfq/FBRTest.sol (7)
13-13
: LGTM!The introduction of the
REBATE_FLAG
constant improves code clarity by replacing a magic number.
14-14
: LGTM!Changing the visibility of
RFQ_DEADLINE
to public enhances its accessibility.
15-15
: LGTM!Changing the visibility of
TOKEN_OUT
to public enhances its accessibility.
16-16
: LGTM!Changing the visibility of
FIXED_FEE
to public enhances its accessibility.
17-17
: LGTM!Changing the visibility of
DST_CHAIN_ID
to public enhances its accessibility.
33-33
: LGTM!Using the
deployRouter
function for router instantiation improves flexibility and extensibility.
38-40
: LGTM!The introduction of the
deployRouter
function encapsulates router deployment logic and allows for potential overrides in derived contracts.contracts/rfq/FastBridgeRouterV2.sol (10)
27-27
: LGTM!The introduction of the
GAS_REBATE_FLAG
constant improves code clarity by replacing a magic number.
18-20
: LGTM!The
SwapQuoterSet
event improves transparency and traceability of changes to the swap quoter.
22-24
: LGTM!The
FastBridgeSet
event improves transparency and traceability of changes to the FastBridge contract.
34-36
: LGTM!The constructor ensures that the contract is owned by the specified owner upon deployment.
39-42
: LGTM!The
setFastBridge
function includes proper access control by restricting the call to the owner.
45-48
: LGTM!The
setSwapQuoter
function includes proper access control by restricting the call to the owner.
51-84
: LGTM!The
bridge
function includes comprehensive logic to handle swaps, pull tokens, and set bridge parameters. It ensures the origin sender address is specified and uses the FastBridge contract to perform the bridging.
87-104
: LGTM!The
getOriginAmountOut
function includes logic to adjust the adapter address if it exists, enhancing the flexibility of the swap queries.
107-127
: LGTM!The
_getOriginSender
function retrieves the origin sender from the raw parameters and ensures backward compatibility by falling back tomsg.sender
if it is an EOA.
129-132
: LGTM!The
_chainGasRequested
function uses theGAS_REBATE_FLAG
constant to determine if the gas rebate flag is present in the raw parameters.test/rfq/FastBridgeRouter.t.sol (8)
Line range hint
19-33
: LGTM!Making the
setUp
functionvirtual
allows for potential overrides in derived contracts. The call toprepareAccount
andsetUpSwapQuoter
improves the organization and readability of the setup logic.
35-40
: LGTM!The
prepareAccount
function improves code readability and reusability by encapsulating the logic for preparing an account.
46-54
: LGTM!The
getOriginQueryNoSwap
function simplifies the creation ofSwapQuery
instances for cases without a swap, reducing redundancy in test cases.
56-64
: LGTM!The
getOriginQueryWithSwap
function simplifies the creation ofSwapQuery
instances for cases with a swap, reducing redundancy in test cases.
Line range hint
116-138
: LGTM!The
test_bridge_noOriginSwap_noGasRebate_senderEOA
function name clarifies the context of the test, and the test logic ensures the expected behavior for the specified scenario.
Line range hint
140-162
: LGTM!The
test_bridge_noOriginSwap_withGasRebate_senderEOA
function name clarifies the context of the test, and the test logic ensures the expected behavior for the specified scenario.
Line range hint
164-186
: LGTM!The
test_bridge_withOriginSwap_noGasRebate_senderEOA
function name clarifies the context of the test, and the test logic ensures the expected behavior for the specified scenario.
Line range hint
189-211
: LGTM!The
test_bridge_withOriginSwap_withGasRebate_senderEOA
function name clarifies the context of the test, and the test logic ensures the expected behavior for the specified scenario.test/rfq/FastBridgeRouterV2.t.sol (18)
16-20
: LGTM!The
setUp
function correctly initializes the test environment.
22-24
: LGTM!The
deployRouter
function correctly deploys theFastBridgeRouterV2
contract.
26-38
: LGTM!The
getDestQueryNoRebateWithOriginSender
function correctly constructs theSwapQuery
object without a gas rebate and includes the origin sender.
40-52
: LGTM!The
getDestQueryWithRebateWithOriginSender
function correctly constructs theSwapQuery
object with a gas rebate and includes the origin sender.
54-56
: LGTM!The
expectRevertOriginSenderNotSpecified
function correctly sets up the expected revert condition.
60-88
: LGTM!The
check_bridge_noOriginSwap
function correctly tests the bridge functionality without an origin swap.
90-118
: LGTM!The
check_bridge_withOriginSwap
function correctly tests the bridge functionality with an origin swap.
121-123
: LGTM!The
test_bridge_noOriginSwap_noGasRebate_senderEOA_withOriginSenderSet
function correctly tests the bridge functionality without an origin swap and without a gas rebate, with the origin sender set.
125-127
: LGTM!The
test_bridge_noOriginSwap_withGasRebate_senderEOA_withOriginSenderSet
function correctly tests the bridge functionality without an origin swap and with a gas rebate, with the origin sender set.
129-131
: LGTM!The
test_bridge_withOriginSwap_noGasRebate_senderEOA_withOriginSenderSet
function correctly tests the bridge functionality with an origin swap and without a gas rebate, with the origin sender set.
133-135
: LGTM!The
test_bridge_withOriginSwap_withGasRebate_senderEOA_withOriginSenderSet
function correctly tests the bridge functionality with an origin swap and with a gas rebate, with the origin sender set.
137-139
: LGTM!The
test_bridge_noOriginSwap_noGasRebate_senderEOA_withOriginSenderZero
function correctly tests the bridge functionality without an origin swap and without a gas rebate, with the origin sender set to zero address.
142-144
: LGTM!The
test_bridge_noOriginSwap_withGasRebate_senderEOA_withOriginSenderZero
function correctly tests the bridge functionality without an origin swap and with a gas rebate, with the origin sender set to zero address.
146-148
: LGTM!The
test_bridge_withOriginSwap_noGasRebate_senderEOA_withOriginSenderZero
function correctly tests the bridge functionality with an origin swap and without a gas rebate, with the origin sender set to zero address.
150-152
: LGTM!The
test_bridge_withOriginSwap_withGasRebate_senderEOA_withOriginSenderZero
function correctly tests the bridge functionality with an origin swap and with a gas rebate, with the origin sender set to zero address.
174-187
: LGTM!The
check_bridge_noOriginSwap_senderContract_revert
function correctly tests the bridge functionality without an origin swap and expects a revert when the origin sender is not specified.
189-203
: LGTM!The
check_bridge_withOriginSwap_senderContract_revert
function correctly tests the bridge functionality with an origin swap and expects a revert when the origin sender is not specified.
205-216
: LGTM!The
test_bridge_noOriginSwap_senderContract_reverts
function correctly tests the bridge functionality without an origin swap and expects reverts in various scenarios.test/rfq/FastBridgeRouter.Native.t.sol (4)
19-19
: LGTM! Thevirtual
keyword usage is appropriate.The
virtual
keyword allows the function to be overridden in derived contracts, which is necessary for extending the test setup in other test contracts.
35-41
: LGTM! Centralizing the minting and approval process is a good practice.The
prepareAccount
function improves code readability and maintainability by centralizing the minting and approval process.
47-87
: LGTM! Encapsulating the logic for creatingSwapQuery
objects is a good practice.The functions
getOriginQueryNoSwap
,getOriginQueryWithSwap
, andgetOriginQueryWithHandleETH
reduce redundancy and improve maintainability by encapsulating the logic for creatingSwapQuery
objects.
Line range hint
91-587
: LGTM! Refactoring the test functions improves code readability and maintainability.The test functions have been refactored to use the new helper functions for creating
SwapQuery
objects, reducing redundancy and improving maintainability.test/rfq/FastBridgeRouterV2.Native.t.sol (6)
16-20
: LGTM! The modifications to thesetUp
function are appropriate.The modifications to the
setUp
function are necessary for testing theFastBridgeRouterV2
contract.
22-24
: LGTM! The deployment of theFastBridgeRouterV2
contract is necessary for testing.The
deployRouter
function correctly deploys a new instance of theFastBridgeRouterV2
contract.
26-52
: LGTM! Encapsulating the logic for creatingSwapQuery
objects with the origin sender address is a good practice.The functions
getDestQueryNoRebateWithOriginSender
andgetDestQueryWithRebateWithOriginSender
improve code readability and maintainability by encapsulating the logic for creatingSwapQuery
objects with the origin sender address.
54-56
: LGTM! Setting up the expectation for a revert with the appropriate selector is necessary for testing error conditions.The
expectRevertOriginSenderNotSpecified
function correctly sets up the expectation for a revert with theFastBridgeRouterV2__OriginSenderNotSpecified
selector.
60-493
: LGTM! The test functions cover a wide range of scenarios for bridging with the origin sender provided.The test functions for EOA with origin sender provided correctly cover various scenarios for bridging from ETH, WETH, and paired tokens.
494-821
: LGTM! The test functions cover a wide range of scenarios for bridging with the origin sender not provided.The test functions for contracts with the origin sender not provided correctly cover various scenarios for bridging from ETH, WETH, and paired tokens.
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {Address} from "@openzeppelin/contracts-4.5.0/utils/Address.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a more recent version of OpenZeppelin contracts.
The import statement uses version 4.5.0 of the OpenZeppelin contracts. Consider using a more recent version if available to benefit from the latest features and security fixes.
import {Address} from "@openzeppelin/contracts-4.5.0/utils/Address.sol";
Committable suggestion was skipped due to low confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- contracts/rfq/FastBridgeRouterV2.sol (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- contracts/rfq/FastBridgeRouterV2.sol
6a91b16
to
a9cd93d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
script/rfq/DeployFastBridgeRouterV2.s.sol (1)
6-6
: Consider renaming the contract for clarity.The contract name
DeployFastBridgeRouter
might be confusing since it deploysFastBridgeRouterV2
. Consider renaming it toDeployFastBridgeRouterV2
for clarity.deployments/mainnet/FastBridgeRouterV2.json (1)
2-3
: Constructor arguments mismatchThe constructor arguments provided in
deployments/mainnet/FastBridgeRouterV2.json
do not match the expected value from theCreate2Factory.salts.json
file.
- Provided Constructor Args:
0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3
- Expected Salt:
0x00000000000000000000000000000000000000006137d2b1087774010a8fadb4
Please verify and correct the constructor arguments.
Analysis chain
Verify the correctness of the address and constructorArgs.
Ensure that the provided address and constructor arguments are correct and consistent with the contract's deployment.
#!/bin/bash # Search for the deployment script or contract artifacts related to FastBridgeRouterV2 to verify the address and constructor arguments. # Locate the deployment script or contract artifacts fd -e json -e js -e ts -e sol -e md -e txt -e yaml -e yml -e toml -e ini -e env -e sh -e bash -e zsh -e fish -e bat -e ps1 -e psd1 -e ps1xml -e psm1 -e pssc -e psrc -e psd -e psf -e psm -e ps1xml -e ps1 -e psm1 -e psc1 -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e psm1 -e psm -e p </details> <details> <summary>Scripts executed</summary> The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the correctness of the address and constructor arguments. # Expected: The address and constructor arguments should match the contract's deployment details. echo "Address: 0xd50042193Db100FE0040005e00D5010000007e45" echo "Constructor Args: 0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3"Length of output: 291
Script:
#!/bin/bash # Searching for deployment scripts or contract artifacts that reference FastBridgeRouterV2 to verify the address and constructor arguments. # Search for references to FastBridgeRouterV2 in JSON files (likely to contain deployment details) rg "FastBridgeRouterV2" -tjson -A 10Length of output: 6102
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (12)
- deployments/arbitrum/FastBridgeRouterV2.json (1 hunks)
- deployments/blast/FastBridgeRouterV2.json (1 hunks)
- deployments/bsc/FastBridgeRouterV2.json (1 hunks)
- deployments/linea/FastBridgeRouterV2.json (1 hunks)
- deployments/mainnet/FastBridgeRouterV2.json (1 hunks)
- deployments/optimism/FastBridgeRouterV2.json (1 hunks)
- deployments/scroll/FastBridgeRouterV2.json (1 hunks)
- script/configs/Create2Factory.salts.json (1 hunks)
- script/networks.json (2 hunks)
- script/rfq-run.sh (1 hunks)
- script/rfq/ConfigureFastBridgeRouterV2.s.sol (1 hunks)
- script/rfq/DeployFastBridgeRouterV2.s.sol (1 hunks)
Files skipped from review due to trivial changes (1)
- script/networks.json
Additional comments not posted (109)
script/rfq/DeployFastBridgeRouterV2.s.sol (4)
7-9
: Ensure proper setup.The
setUp
function initializes the script. Ensure that it correctly sets up all necessary parameters and configurations.
10-10
: Broadcasting start.The
vm.startBroadcast()
is correctly placed to start broadcasting the transactions.
11-17
: Deployment logic looks good.The deployment logic using
deployAndSave
with CREATE2 is correctly implemented. Ensure thatdeployCreate2
andabi.encode(msg.sender)
are correctly defined and used.
18-18
: Broadcasting stop.The
vm.stopBroadcast()
is correctly placed to stop broadcasting the transactions.script/configs/Create2Factory.salts.json (1)
12-16
: Verify the correctness of the values.Ensure that the
initCodeHash
,predictedAddress
, andsalt
values forFastBridgeRouterV2
are correctly defined and used.script/rfq-run.sh (9)
1-1
: Add a shebang line.The shebang line
#!/usr/bin/env bash
is correctly added to specify the script interpreter.
2-3
: Add usage comments.The usage comments are helpful for understanding how to use the script.
6-8
: Define colors.The colors are correctly defined for use in the script.
10-12
: Check for required arguments.The script correctly checks for the required arguments and shifts them.
14-17
: Handle missing arguments.The script correctly handles missing arguments and provides a usage message.
19-20
: Find FastBridge deployments.The script correctly finds all
FastBridge.json
files in the./deployments
directory.
21-22
: Extract and sort chain names.The script correctly extracts and sorts chain names from the list of filenames.
24-25
: Format and print chain names.The script correctly formats and prints the comma-separated list of chain aliases.
27-29
: Run the script for each chain.The script correctly runs the specified script for each chain.
script/rfq/ConfigureFastBridgeRouterV2.s.sol (5)
4-4
: LGTM!The import statement for
FastBridgeRouterV2
is necessary and correct.
8-9
: LGTM!The class name change to
ConfigureFastBridgeRouterV2
and the update to useFastBridgeRouterV2
are necessary and correct.
13-14
: LGTM!The changes to the
setUp
method to fetch the deployment address forFastBridgeRouterV2
and initialize the router instance are necessary and correct.
21-21
: LGTM!The change to the
run
method to callconfigureFastBridgeRouterV2
is necessary and correct.
25-35
: LGTM!The changes to the
configureFastBridgeRouterV2
method to interact with the new router instance are necessary and correct.deployments/arbitrum/FastBridgeRouterV2.json (4)
2-3
: LGTM!The address and constructor arguments for the deployed contract are necessary and correct.
6-19
: LGTM!The constructor and receive function in the ABI are necessary and correct.
21-304
: LGTM!The functions in the ABI are necessary and correct.
306-394
: LGTM!The events and errors in the ABI are necessary and correct.
deployments/blast/FastBridgeRouterV2.json (4)
2-3
: LGTM!The address and constructor arguments for the deployed contract are necessary and correct.
6-19
: LGTM!The constructor and receive function in the ABI are necessary and correct.
21-304
: LGTM!The functions in the ABI are necessary and correct.
306-394
: LGTM!The events and errors in the ABI are necessary and correct.
deployments/bsc/FastBridgeRouterV2.json (26)
5-15
: Constructor ABI EntryThe constructor ABI entry looks correct.
16-19
: Receive Function ABI EntryThe receive function ABI entry looks correct.
21-32
: GAS_REBATE_FLAG Function ABI EntryThe
GAS_REBATE_FLAG
function ABI entry looks correct.
34-71
: adapterSwap Function ABI EntryThe
adapterSwap
function ABI entry looks correct.
73-163
: bridge Function ABI EntryThe
bridge
function ABI entry looks correct.
165-176
: fastBridge Function ABI EntryThe
fastBridge
function ABI entry looks correct.
178-232
: getOriginAmountOut Function ABI EntryThe
getOriginAmountOut
function ABI entry looks correct.
234-245
: owner Function ABI EntryThe
owner
function ABI entry looks correct.
247-252
: renounceOwnership Function ABI EntryThe
renounceOwnership
function ABI entry looks correct.
254-265
: setFastBridge Function ABI EntryThe
setFastBridge
function ABI entry looks correct.
267-278
: setSwapQuoter Function ABI EntryThe
setSwapQuoter
function ABI entry looks correct.
280-291
: swapQuoter Function ABI EntryThe
swapQuoter
function ABI entry looks correct.
293-304
: transferOwnership Function ABI EntryThe
transferOwnership
function ABI entry looks correct.
306-317
: FastBridgeSet Event ABI EntryThe
FastBridgeSet
event ABI entry looks correct.
319-336
: OwnershipTransferred Event ABI EntryThe
OwnershipTransferred
event ABI entry looks correct.
338-349
: SwapQuoterSet Event ABI EntryThe
SwapQuoterSet
event ABI entry looks correct.
351-354
: DeadlineExceeded Error ABI EntryThe
DeadlineExceeded
error ABI entry looks correct.
356-359
: FastBridgeRouterV2__OriginSenderNotSpecified Error ABI EntryThe
FastBridgeRouterV2__OriginSenderNotSpecified
error ABI entry looks correct.
361-364
: InsufficientOutputAmount Error ABI EntryThe
InsufficientOutputAmount
error ABI entry looks correct.
366-369
: MsgValueIncorrect Error ABI EntryThe
MsgValueIncorrect
error ABI entry looks correct.
371-374
: PoolNotFound Error ABI EntryThe
PoolNotFound
error ABI entry looks correct.
376-379
: TokenAddressMismatch Error ABI EntryThe
TokenAddressMismatch
error ABI entry looks correct.
381-384
: TokenNotContract Error ABI EntryThe
TokenNotContract
error ABI entry looks correct.
386-389
: TokenNotETH Error ABI EntryThe
TokenNotETH
error ABI entry looks correct.
391-394
: TokensIdentical Error ABI EntryThe
TokensIdentical
error ABI entry looks correct.
2-3
: Verify the correctness of the address and constructorArgs.Ensure that the provided address and constructor arguments are correct and consistent with the contract's deployment.
Verification successful
The address and constructor arguments are correct and consistent with the contract's deployment details.
- Address:
0xd50042193Db100FE0040005e00D5010000007e45
- Constructor Args:
0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the address and constructor arguments. # Expected: The address and constructor arguments should match the contract's deployment details. echo "Address: 0xd50042193Db100FE0040005e00D5010000007e45" echo "Constructor Args: 0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3"Length of output: 291
Script:
#!/bin/bash # Description: Search for deployment details of the FastBridgeRouterV2 contract to verify the address and constructor arguments. # Search for the deployment script or configuration file that includes the FastBridgeRouterV2 contract rg 'FastBridgeRouterV2' -A 10Length of output: 22977
Script:
#!/bin/bash # Description: Decode the constructor arguments to verify if they match the expected encoding of the deployer's address. # Decode the constructor arguments echo "0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3" | xxd -r -p | hexdump -CLength of output: 244
Script:
#!/bin/bash # Description: Decode the constructor arguments to verify if they match the expected encoding of the deployer's address. # Decode the constructor arguments using jq echo '{"constructorArgs": "0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3"}' | jq -r '.constructorArgs'Length of output: 190
deployments/linea/FastBridgeRouterV2.json (26)
5-15
: Constructor ABI EntryThe constructor ABI entry looks correct.
16-19
: Receive Function ABI EntryThe receive function ABI entry looks correct.
21-32
: GAS_REBATE_FLAG Function ABI EntryThe
GAS_REBATE_FLAG
function ABI entry looks correct.
34-71
: adapterSwap Function ABI EntryThe
adapterSwap
function ABI entry looks correct.
73-163
: bridge Function ABI EntryThe
bridge
function ABI entry looks correct.
165-176
: fastBridge Function ABI EntryThe
fastBridge
function ABI entry looks correct.
178-232
: getOriginAmountOut Function ABI EntryThe
getOriginAmountOut
function ABI entry looks correct.
234-245
: owner Function ABI EntryThe
owner
function ABI entry looks correct.
247-252
: renounceOwnership Function ABI EntryThe
renounceOwnership
function ABI entry looks correct.
254-265
: setFastBridge Function ABI EntryThe
setFastBridge
function ABI entry looks correct.
267-278
: setSwapQuoter Function ABI EntryThe
setSwapQuoter
function ABI entry looks correct.
280-291
: swapQuoter Function ABI EntryThe
swapQuoter
function ABI entry looks correct.
293-304
: transferOwnership Function ABI EntryThe
transferOwnership
function ABI entry looks correct.
306-317
: FastBridgeSet Event ABI EntryThe
FastBridgeSet
event ABI entry looks correct.
319-336
: OwnershipTransferred Event ABI EntryThe
OwnershipTransferred
event ABI entry looks correct.
338-349
: SwapQuoterSet Event ABI EntryThe
SwapQuoterSet
event ABI entry looks correct.
351-354
: DeadlineExceeded Error ABI EntryThe
DeadlineExceeded
error ABI entry looks correct.
356-359
: FastBridgeRouterV2__OriginSenderNotSpecified Error ABI EntryThe
FastBridgeRouterV2__OriginSenderNotSpecified
error ABI entry looks correct.
361-364
: InsufficientOutputAmount Error ABI EntryThe
InsufficientOutputAmount
error ABI entry looks correct.
366-369
: MsgValueIncorrect Error ABI EntryThe
MsgValueIncorrect
error ABI entry looks correct.
371-374
: PoolNotFound Error ABI EntryThe
PoolNotFound
error ABI entry looks correct.
376-379
: TokenAddressMismatch Error ABI EntryThe
TokenAddressMismatch
error ABI entry looks correct.
381-384
: TokenNotContract Error ABI EntryThe
TokenNotContract
error ABI entry looks correct.
386-389
: TokenNotETH Error ABI EntryThe
TokenNotETH
error ABI entry looks correct.
391-394
: TokensIdentical Error ABI EntryThe
TokensIdentical
error ABI entry looks correct.
2-3
: Verify the correctness of the address and constructorArgs.Ensure that the provided address and constructor arguments are correct and consistent with the contract's deployment.
Verification successful
The address and constructor arguments are verified and consistent with the contract's deployment details.
The address
0xd50042193Db100FE0040005e00D5010000007e45
and constructor arguments0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3
are correctly specified and appear multiple times in the deployment JSON files, confirming their accuracy.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the address and constructor arguments. # Expected: The address and constructor arguments should match the contract's deployment details. echo "Address: 0xd50042193Db100FE0040005e00D5010000007e45" echo "Constructor Args: 0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3"Length of output: 291
Script:
#!/bin/bash # Search for the contract deployment details to verify the address and constructor arguments. # Find all JSON files that might contain deployment details fd -e json --exec cat {} + | rg -i '0xd50042193Db100FE0040005e00D5010000007e45|0fea3e5840334fc758a3decf14546bfdfbef5cd3' -A 5 -B 5Length of output: 75201
deployments/mainnet/FastBridgeRouterV2.json (14)
5-15
: Constructor ABI EntryThe constructor ABI entry looks correct.
16-19
: Receive Function ABI EntryThe receive function ABI entry looks correct.
21-32
: GAS_REBATE_FLAG Function ABI EntryThe
GAS_REBATE_FLAG
function ABI entry looks correct.
34-71
: adapterSwap Function ABI EntryThe
adapterSwap
function ABI entry looks correct.
73-163
: bridge Function ABI EntryThe
bridge
function ABI entry looks correct.
165-176
: fastBridge Function ABI EntryThe
fastBridge
function ABI entry looks correct.
178-232
: getOriginAmountOut Function ABI EntryThe
getOriginAmountOut
function ABI entry looks correct.
234-245
: owner Function ABI EntryThe
owner
function ABI entry looks correct.
247-252
: renounceOwnership Function ABI EntryThe
renounceOwnership
function ABI entry looks correct.
254-265
: setFastBridge Function ABI EntryThe
setFastBridge
function ABI entry looks correct.
267-278
: setSwapQuoter Function ABI EntryThe
setSwapQuoter
function ABI entry looks correct.
280-291
: swapQuoter Function ABI EntryThe
swapQuoter
function ABI entry looks correct.
293-304
: transferOwnership Function ABI EntryThe
transferOwnership
function ABI entry looks correct.
306-317
: FastBridgeSet Event ABI EntryThe
FastBridgeSet
event ABI entry looks correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- deployments/arbitrum/FastBridgeRouterV2.json (1 hunks)
- deployments/base/FastBridgeRouterV2.json (1 hunks)
- deployments/blast/FastBridgeRouterV2.json (1 hunks)
- deployments/bsc/FastBridgeRouterV2.json (1 hunks)
- deployments/linea/FastBridgeRouterV2.json (1 hunks)
- deployments/mainnet/FastBridgeRouterV2.json (1 hunks)
- deployments/optimism/FastBridgeRouterV2.json (1 hunks)
- deployments/scroll/FastBridgeRouterV2.json (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- deployments/arbitrum/FastBridgeRouterV2.json
- deployments/blast/FastBridgeRouterV2.json
- deployments/bsc/FastBridgeRouterV2.json
- deployments/linea/FastBridgeRouterV2.json
- deployments/mainnet/FastBridgeRouterV2.json
- deployments/optimism/FastBridgeRouterV2.json
- deployments/scroll/FastBridgeRouterV2.json
Additional comments not posted (5)
deployments/base/FastBridgeRouterV2.json (5)
2-3
: Verify the contract address and constructor arguments.Ensure that the contract address
0xd50042193Db100FE0040005e00D5010000007e45
and constructor arguments0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3
are correct and match the deployment configuration.Verification successful
The contract address and constructor arguments are correct.
The contract address
0xd50042193Db100FE0040005e00D5010000007e45
and constructor arguments0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3
match those found in other deployment files, indicating they are correct and consistent across multiple environments.
deployments/base/FastBridgeRouterV2.json
deployments/scroll/FastBridgeRouterV2.json
deployments/optimism/FastBridgeRouterV2.json
deployments/mainnet/FastBridgeRouterV2.json
deployments/linea/FastBridgeRouterV2.json
deployments/bsc/FastBridgeRouterV2.json
deployments/blast/FastBridgeRouterV2.json
deployments/arbitrum/FastBridgeRouterV2.json
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the contract address and constructor arguments. # Test: Search for the contract address and constructor arguments in the deployment scripts. rg --type json '0xd50042193Db100FE0040005e00D5010000007e45' rg --type json '0x0000000000000000000000000fea3e5840334fc758a3decf14546bfdfbef5cd3'Length of output: 3192
5-19
: Verify the constructor and receive functions.Ensure that the constructor and receive functions are correctly defined and match the contract implementation.
351-394
: Verify the error definitions.Ensure that the error definitions are correctly defined and match the contract implementation.
Verification successful
Verify the error definitions.
Ensure that the error definitions are correctly defined and match the contract implementation.
The error definitions are correctly implemented.
The following errors are defined within the Solidity contracts:
DeadlineExceeded
FastBridgeRouterV2__OriginSenderNotSpecified
InsufficientOutputAmount
MsgValueIncorrect
PoolNotFound
TokenAddressMismatch
TokenNotContract
TokenNotETH
TokensIdentical
Locations:
contracts/router/libs/Errors.sol
contracts/rfq/FastBridgeRouterV2.sol
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the error definitions. # Test: Search for the error definitions in the contract implementation. rg --type solidity 'error DeadlineExceeded()' rg --type solidity 'error FastBridgeRouterV2__OriginSenderNotSpecified()' rg --type solidity 'error InsufficientOutputAmount()' rg --type solidity 'error MsgValueIncorrect()' rg --type solidity 'error PoolNotFound()' rg --type solidity 'error TokenAddressMismatch()' rg --type solidity 'error TokenNotContract()' rg --type solidity 'error TokenNotETH()' rg --type solidity 'error TokensIdentical()'Length of output: 759
Script:
#!/bin/bash # Description: Verify the error definitions. # Test: Search for the error definitions in Solidity files. rg 'error DeadlineExceeded()' --glob '*.sol' rg 'error FastBridgeRouterV2__OriginSenderNotSpecified()' --glob '*.sol' rg 'error InsufficientOutputAmount()' --glob '*.sol' rg 'error MsgValueIncorrect()' --glob '*.sol' rg 'error PoolNotFound()' --glob '*.sol' rg 'error TokenAddressMismatch()' --glob '*.sol' rg 'error TokenNotContract()' --glob '*.sol' rg 'error TokenNotETH()' --glob '*.sol' rg 'error TokensIdentical()' --glob '*.sol'Length of output: 1023
21-304
: Verify the function definitions.Ensure that the function definitions are correctly defined and match the contract implementation.
306-349
: Verify the event definitions.Ensure that the event definitions are correctly defined and match the contract implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- contracts/rfq/FastBridgeRouterV2.sol (1 hunks)
- test/rfq/FastBridgeRouterV2.Native.t.sol (1 hunks)
- test/rfq/FastBridgeRouterV2.t.sol (1 hunks)
Files skipped from review due to trivial changes (1)
- test/rfq/FastBridgeRouterV2.t.sol
Files skipped from review as they are similar to previous changes (2)
- contracts/rfq/FastBridgeRouterV2.sol
- test/rfq/FastBridgeRouterV2.Native.t.sol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
script/rfq/BrickFastBridgeRouter.s.sol (1)
11-15
: Ensure the setup function correctly initializes the router.The
setUp
function overrides the parent class'ssetUp
function, initializes theFastBridgeRouter
instance, and assigns it to therouter
state variable. However, the deployment address forFastBridgeRouter
is not found in the deployment JSON files. Ensure that the deployment address forFastBridgeRouter
is correctly configured and retrievable.
- Verify the presence and correctness of the deployment address for
FastBridgeRouter
in the deployment JSON files.- Ensure that the
getDeploymentAddress
function can correctly retrieve the deployment address forFastBridgeRouter
.Analysis chain
Ensure the setup function correctly initializes the router.
The
setUp
function overrides the parent class'ssetUp
function, initializes theFastBridgeRouter
instance, and assigns it to therouter
state variable. Ensure the deployment address is correct.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the deployment address for `FastBridgeRouter`. # Test: Check if the deployment address is correctly retrieved. Expect: The address should be valid. rg 'getDeploymentAddress' -A 5Length of output: 19005
Script:
#!/bin/bash # Locate the implementation of getDeploymentAddress used in BrickFastBridgeRouter.s.sol rg 'function getDeploymentAddress' -A 5 # Check for the presence of deployment address configurations for FastBridgeRouter fd -e json | xargs grep -i 'FastBridgeRouter'Length of output: 2837
Script:
#!/bin/bash # Search for references to FastBridgeRouter in the codebase to ensure it is correctly named and used. rg 'FastBridgeRouter'Length of output: 8900
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (12)
- deployments/arbitrum/FastBridgeRouterV2.json (1 hunks)
- deployments/base/FastBridgeRouterV2.json (1 hunks)
- deployments/blast/FastBridgeRouterV2.json (1 hunks)
- deployments/bsc/FastBridgeRouterV2.json (1 hunks)
- deployments/linea/FastBridgeRouterV2.json (1 hunks)
- deployments/mainnet/FastBridgeRouterV2.json (1 hunks)
- deployments/optimism/FastBridgeRouterV2.json (1 hunks)
- deployments/scroll/FastBridgeRouterV2.json (1 hunks)
- script/configs/Create2Factory.salts.json (1 hunks)
- script/rfq/BrickFastBridgeRouter.s.sol (1 hunks)
- script/rfq/rfq-cmd.sh (1 hunks)
- script/rfq/rfq-run.sh (1 hunks)
Files skipped from review as they are similar to previous changes (8)
- deployments/arbitrum/FastBridgeRouterV2.json
- deployments/base/FastBridgeRouterV2.json
- deployments/blast/FastBridgeRouterV2.json
- deployments/bsc/FastBridgeRouterV2.json
- deployments/linea/FastBridgeRouterV2.json
- deployments/mainnet/FastBridgeRouterV2.json
- deployments/optimism/FastBridgeRouterV2.json
- deployments/scroll/FastBridgeRouterV2.json
Additional comments not posted (14)
script/rfq/rfq-run.sh (3)
1-8
: LGTM!The shebang line, comments, and color definitions are correct and useful.
10-17
: LGTM!The argument parsing and usage instructions are correct and clear.
19-19
: LGTM!The script execution is straightforward and correct.
script/configs/Create2Factory.salts.json (1)
12-16
: Verify the values forFastBridgeRouterV2
.Ensure that the
initCodeHash
,predictedAddress
, andsalt
values are correct.Verification successful
Verify the values for
FastBridgeRouterV2
.The values for
initCodeHash
,predictedAddress
, andsalt
are consistent across the repository and appear to be correct.
initCodeHash
: Found only inCreate2Factory.salts.json
.predictedAddress
: Consistent across multiple deployment JSON files.salt
: Found only inCreate2Factory.salts.json
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the values for `FastBridgeRouterV2`. # Test: Check the values in the configuration file. Expect: Correct values for `FastBridgeRouterV2`. grep -A 3 '"FastBridgeRouterV2"' script/configs/Create2Factory.salts.jsonLength of output: 342
Script:
#!/bin/bash # Description: Search for references to `FastBridgeRouterV2` and its values in the repository. # Search for references to `FastBridgeRouterV2` in the repository rg -A 3 'FastBridgeRouterV2' . # Search for the `initCodeHash` value in the repository rg '0x27f5c13b6e4bed194d26ed65fa860d6af815eff7e634fee55ac9c039ce5105b7' . # Search for the `predictedAddress` value in the repository rg '0x00cD000000003f7F682BE4813200893d4e690000' . # Search for the `salt` value in the repository rg '0x0000000000000000000000000000000000000000d03957700745a831060da626' .Length of output: 13113
script/rfq/rfq-cmd.sh (4)
1-8
: LGTM!The shebang line, comments, and color definitions are correct and useful.
10-17
: LGTM!The argument parsing and usage instructions are correct and clear.
19-25
: LGTM!The chain extraction and formatting logic is correct and efficient.
27-29
: LGTM!The command execution logic is correct and straightforward.
script/rfq/BrickFastBridgeRouter.s.sol (6)
1-2
: Specify the license and pragma version.The SPDX license identifier and pragma version are correctly specified.
8-10
: Declare state variables at the top.The state variable
router
is correctly declared at the top of the contract.
4-4
: Ensure the imported contract path is correct.The import statement for
FastBridgeRouter
should be verified to ensure the correct path.Verification successful
The import path for
FastBridgeRouter
is correct.
- The file
FastBridgeRouter.sol
exists at the specified path:./contracts/rfq/FastBridgeRouter.sol
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the path of the imported contract `FastBridgeRouter`. # Test: Check if the file exists. Expect: The file should exist at the specified path. fd 'FastBridgeRouter.sol' --exec echoLength of output: 123
25-32
: Ensure the brickFastBridgeRouter function correctly handles the fast bridge logic.The
brickFastBridgeRouter
function checks if the fast bridge is set and updates it accordingly. Ensure thefastBridge
andsetFastBridge
functions are correctly implemented inFastBridgeRouter
.Verification successful
The
fastBridge
andsetFastBridge
functions are correctly implemented.
fastBridge
is defined incontracts/rfq/interfaces/IFastBridgeRouter.sol
as an external view function returning an address.setFastBridge
is defined incontracts/rfq/FastBridgeRouterV2.sol
andcontracts/rfq/FastBridgeRouter.sol
as an external function that sets thefastBridge
address and emits an event. It is protected by theonlyOwner
modifier.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of `fastBridge` and `setFastBridge` functions in `FastBridgeRouter`. # Test: Check if the functions are correctly implemented. Expect: The functions should be defined and valid. rg 'function fastBridge' -A 5 rg 'function setFastBridge' -A 5Length of output: 1919
6-6
: Ensure the imported script path is correct.The import statement for
BasicSynapseScript
should be verified to ensure the correct path.Verification successful
To ensure the correct import path, we need to verify the location of
BrickFastBridgeRouter.s.sol
.
The import path is correct.
The file
BasicSynapse.s.sol
exists at the expected path, and the relative import path used inBrickFastBridgeRouter.s.sol
is accurate.
BrickFastBridgeRouter.s.sol
is located at./script/rfq/BrickFastBridgeRouter.s.sol
.BasicSynapse.s.sol
is located at./script/templates/BasicSynapse.s.sol
.- The import statement
import {BasicSynapseScript} from "../templates/BasicSynapse.s.sol";
correctly points to the file.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the path of the imported script `BasicSynapseScript`. # Test: Check if the file exists. Expect: The file should exist at the specified path. fd 'BasicSynapse.s.sol' --exec echoLength of output: 73
Script:
#!/bin/bash # Description: Verify the location of the script `BrickFastBridgeRouter.s.sol`. # Test: Check if the file exists at the expected path. fd 'BrickFastBridgeRouter.s.sol' --exec echoLength of output: 85
17-23
: Ensure the run function correctly orchestrates the script execution.The
run
function sets up the script, starts broadcasting, callsbrickFastBridgeRouter
, and stops broadcasting. Ensure the functionssetUp
,vm.startBroadcast
, andvm.stopBroadcast
are correctly implemented.
Description
Introduces the updated version of
FastBridgeRouter
, which allows to specify the origin sender address (aka the potential refund address) without breaking changes in interface. To achieve that the address needs to be encoded indestQuery.rawParams
, which is currently only used to signal the necessity of the gas airdrop. This cahnge is possible since the swaps on the destination chain are not supported, and therefore this parameter is not used otherwise.Checklist
Summary by CodeRabbit
New Features
Documentation